Event Condition Action (ECA) is an example of a rules-based approach used in an event driven system, such as a database system. Typically, the ECA rule includes an event part for specifying what triggers the invocation of the ECA rule, a condition part, which is a logical test that, if satisfied to true, causes the action to be carried out, and an action part, which includes updates or invocations on the local data at the database. In a database system, the condition could simply be a query to the database, with the result set being passed to the action part for changes to the database. Actions could also be calls to external programs or remote procedures. ECA rules can be used for activities such as automatically enforcing document constraints, maintaining repository statistics, running business processes, and facilitating publish/subscribe applications.